//using Microsoft.VisualBasic;
using System;

//
// *  NHibernate 代码模版
// 
using System.IO;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters.Binary;

namespace NCS
{
	/// <summary>
	///	
	/// </summary>
	[Serializable()]
    public class method : ICloneable
	{

		#region "构造方法"
		public method()
		{
			m_ID = 0;
			m_cuser = null;
			m_cname = null;
			m_tuoqiPower = 4000;
			m_chongxi_power = 3500;
			m_dengdai_power = 3500;
			m_sample_delay = 1;
			//m_zerovalue = 0
			//m_useJiaozheng = False
			m_cswitch = 9.9;
			m_sswitch = 9.9;
			m_smoothnum = 30;
			m_sampletime = 50;
			//采样时间
			m_flushtime = 15;
			//冲洗时间
			//m_panju = 0
			m_tuoqiTime = 20;
			//脱气时间
			m_dengdaitime = 50;
			m_jieqi = false;
			m_wlC = 0;
			m_wlS = 0;
		}
        public method(method m2)
        {
            //m_ID = m2.ID ;
            m_cuser = m2.cuser ;
            m_cname = m2.cname ;
            m_tuoqiPower = m2.tuoqiPower ;
            m_chongxi_power = m2.chongxi_power ;
            m_dengdai_power = m2.dengdai_power ;
            m_sample_delay = m2.sample_delay ;
            //m_zerovalue = 0
            //m_useJiaozheng = False
            m_cswitch = m2.cswitch ;
            m_sswitch = m2.sswitch ;
            m_smoothnum = m2.smoothnum ;
            m_sampletime = m2.sampletime ;
            //采样时间
            m_flushtime = m2.flushtime ;
            //冲洗时间
            //m_panju = 0
            m_tuoqiTime = m2.tuoqiTime ;
            //脱气时间
            m_dengdaitime = m2.dengdaitime ;
            m_jieqi = m2.jieqi ;
            m_wlC = m2.wlC ;
            m_wlS = m2.wlS ;
            foreach (curveXishu d in m2.curveXishuList)
            {
                curveXishu d1 = (curveXishu)d.Clone();
                d1.method = this;
                this.m_curveXishuList.Add(d1);
            }
            foreach (powerSet  d in m2.powerList )
            {
                powerSet  d1 = (powerSet)d.Clone();
                d1.method = this;
                this.m_powerList.Add(d1);
            }
        }
		#endregion
        public virtual object Clone()
        {
            return new method(this);
        }

		#region "私有变量"
		private int m_ID;
		private string m_cuser;
		private string m_cname;
		private int m_tuoqiPower;
		private int m_chongxi_power;
		private int m_dengdai_power;
		private int m_sample_delay;
		//Private m_zerovalue As Double
		//Private m_useJiaozheng As Boolean
		private double m_cswitch;
		private double m_sswitch;
		private short m_smoothnum;
		private int m_sampletime;
		private int m_dengdaitime;
		private int m_flushtime;
		//Private m_panju As Double
		private int m_tuoqiTime;
		private bool m_jieqi;
		private double m_wlC;
		private double m_wlS;
		private IList<curveXishu> m_curveXishuList = new List<curveXishu>();

		private IList<powerSet> m_powerList = new List<powerSet>();
		#endregion


		#region "公有属性"
		//Function ShallowClone() As method
		//    Return CType(Me.MemberwiseClone(), method)
		//End Function

		//' This is one way to do deep cloning. But works only if the 
		//' objects and its references are serializable
		//Function DeepClone() As method
		//    Dim m As New MemoryStream
		//    Dim b As New BinaryFormatter
		//    b.Serialize(m, Me)
		//    m.Position = 0
		//    Return b.Deserialize(m)
		//End Function
		///<summary>
		///
		///</summary>
		public virtual int ID {
			get { return m_ID; }
			set { m_ID = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual string cuser {
			get { return m_cuser; }
			set { m_cuser = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual string cname {
			get { return m_cname; }
			set { m_cname = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual int tuoqiPower {
			get { return m_tuoqiPower; }
			set { m_tuoqiPower = value; }
		}
		public virtual int chongxi_power {
			get { return m_chongxi_power; }
			set { m_chongxi_power = value; }
		}

		///<summary>
		///
		///</summary>
		//Public Overridable Property zerovalue() As Single
		//    Get
		//        Return m_zerovalue
		//    End Get
		//    Set(ByVal value As Single)
		//        m_zerovalue = Value
		//    End Set
		//End Property

		///<summary>
		///
		///</summary>
		//Public Overridable Property useJiaozheng() As Boolean
		//    Get
		//        Return m_useJiaozheng
		//    End Get
		//    Set(ByVal value As Boolean)
		//        m_useJiaozheng = Value
		//    End Set
		//End Property

		///<summary>
		///
		///</summary>
		public virtual double cswitch {
			get { return m_cswitch; }
			set { m_cswitch = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual double sswitch {
			get { return m_sswitch; }
			set { m_sswitch = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual short smoothnum {
			get { return m_smoothnum; }
			set { m_smoothnum = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual int sampletime {
			get { return m_sampletime; }
			set { m_sampletime = value; }
		}
		public virtual int dengdai_power {
			get { return m_dengdai_power; }
			set { m_dengdai_power = value; }
		}
		public virtual int sample_delay {
			get { return m_sample_delay; }
			set { m_sample_delay = value; }
		}
		public virtual int dengdaitime {
			get { return m_dengdaitime; }
			set { m_dengdaitime = value; }
		}
		///<summary>
		///
		///</summary>
		public virtual int flushtime {
			get { return m_flushtime; }
			set { m_flushtime = value; }
		}

		///<summary>
		///
		///</summary>
		//Public Overridable Property panju() As Double
		//    Get
		//        Return m_panju
		//    End Get
		//    Set(ByVal value As Double)
		//        m_panju = Value
		//    End Set
		//End Property

		///<summary>
		///
		///</summary>
		public virtual int tuoqiTime {
			get { return m_tuoqiTime; }
			set { m_tuoqiTime = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual bool jieqi {
			get { return m_jieqi; }
			set { m_jieqi = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual double wlC {
			get { return m_wlC; }
			set { m_wlC = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual double wlS {
			get { return m_wlS; }
			set { m_wlS = value; }
		}

		///<summary>
		///
		///</summary>
		public virtual IList<curveXishu> curveXishuList {
			get { return m_curveXishuList; }
			set { m_curveXishuList = value; }
		}
		public virtual IList<powerSet> powerList {
			get { return m_powerList; }
			set { m_powerList = value; }
		}
		//Public Function getChanel(ByVal vele As String) As curveXishu
		//    Dim c As curveXishu
		//    c = Nothing
		//    For Each c In Me.m_curveXishuList
		//        If c.ele = vele Then
		//            Exit For
		//        End If
		//    Next
		//    Return c
		//End Function
		#endregion

		#region "Rewrite Equals and HashCode"
		/// <summary>
		/// 
		/// </summary>
		public override bool Equals(object obj)
		{
			if (object.ReferenceEquals(this, obj)) {
				return true;
			}
			if ((obj == null) || (!object.ReferenceEquals(obj.GetType(), GetType()))) {
				return false;
			}
			method castObj = (method)obj;
			return (castObj != null) && (m_ID == castObj.ID);
		}
		/// <summary>
		/// 用唯一值实现GetHashCode
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * m_ID.GetHashCode();
			return hash;
		}
		#endregion
	}
}
